package com.efast.cafe.portal.remote.common;

import java.util.List;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.efast.cafe.framework.feign.constant.FeignConstant;
import com.efast.cafe.portal.bean.common.AttachmentBean;
import com.efast.cafe.portal.bean.common.AttachmentFormBean;
import com.efast.cafe.portal.bean.common.FileUploadReturnBean;
import com.efast.cafe.portal.entity.common.PortalAttachment;
import com.efast.cafe.portal.entity.common.PortalAttachmentBean;
import com.efast.cafe.portal.entity.common.PortalAttachmentForm;


/******************************************************************************
 * @File name : PortalAttachmentService.java
 * 
 * @Author : fxm
 * 
 * @Date : 2016-11-18
 * 
 * @Copyright Notice: Copyright (c) 2016 Efast Serv. All Rights Reserved. This
 *            software is published under the terms of the Efast Software
 *            License version 1.0, a copy of which has been included with this
 *            distribution in the LICENSE.txt file.
 * 
 *            ------------------------------------------------------------------
 *            ---------- Date Who Version Comments 2016-11-18 下午2:11:53 fxm 1.0
 *            Initial Version
 *****************************************************************************/
@FeignClient(name = "cafe.portal-service",path="/cafe.portal-service")
public interface PortalAttachmentService {

	
	@RequestMapping(value = FeignConstant.Scope.FEIGN_SCOPE_PV_AUTH+"/portal/common/queryAttachmentById",method=RequestMethod.POST)
	public PortalAttachment api_queryAttachmentById(@RequestParam("id")Integer id);
	
	@RequestMapping(value = FeignConstant.Scope.FEIGN_SCOPE_PV_AUTH+"/portal/common/saveAttachmentForm",method=RequestMethod.POST)
	public void saveAttachmentForm(@RequestParam("formId")String formId,@RequestBody(required = false) List<PortalAttachmentForm> list);

	@RequestMapping(value = FeignConstant.Scope.FEIGN_SCOPE_PV_AUTH+"/portal/common/api_saveAttrachment",method=RequestMethod.POST)
	public List<FileUploadReturnBean> api_saveAttrachment(@RequestBody(required = false) List<PortalAttachment> portalAttachments);

	@RequestMapping(value = FeignConstant.Scope.FEIGN_SCOPE_PV+"/portal/common/api_saveAttrachment",method=RequestMethod.POST)
	public List<FileUploadReturnBean> api_saveAttrachment(@RequestParam(required = false,value="companyCode")String companyCode,@RequestParam(required = false,value="username")String username, @RequestBody(required = false)List<PortalAttachment> portalAttachments);

	
	@RequestMapping(value = FeignConstant.Scope.FEIGN_SCOPE_PV_AUTH+"/portal/common/queryAttachmentListByFormId",method=RequestMethod.POST)
	public List<PortalAttachmentBean> queryAttachmentFormListByFormId(@RequestParam("formId")String formId);
}
